package top.lyc829.days.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.lyc829.days.bean.User;
import top.lyc829.days.dao.UserDao;

@Service
public class UserService {

    @Autowired
    UserDao userDao;

    public void addUser(User user) {
        userDao.save(user);
    }

    public User getUserByUserName(String name) {
        return userDao.findByUsername(name);
    }

    public User getUserByUserNameAndPassword(String username, String password) {
        return userDao.findByUsernameAndPassword(username, password);
    }

}
